Skip to content

fix(admin): redact the secrets inside a container-valued settings write - #1350

Merged
cameri merged 1 commit into
rewrite/mainfrom
fix/1193-redact-container-settings-writes
Dec 2, 2026
Merged

cameri merged 1 commit into
rewrite/mainfrom
fix/1193-redact-container-settings-writes

Conversation

@chappie-daemon

Copy link
Copy Markdown
Collaborator

A settings write whose path is a container redacts that container's secrets in the response echo and in the settings.changed outbox row, instead of returning and publishing them raw. Closes #1193.

Cherry-picked from saket0187/nostream#6 with -x, by @saket0187, so authorship and the changeset stay theirs.

What it fixes

PATCH /admin/settings redacted a written value only when the exact path was a secret. Writing a parent path (admin.notifications) echoed every target's url and botToken back in the response and queued them in settings.changed, which is delivered to the notification channel and stored.

The change walks the written value from the write path, using the same classification settings_get already applies, so a nested secret is redacted by where it sits rather than by the path that named it. It also fixes two misses in the walker itself: a path padded with whitespace (parse_path trims it on write, the classifier did not) and a secret[label] suffix whose bracket was stripped even when the label was not numeric.

Testing

Against ead3997e (the fork's base), the new tests fail: 4 of 12 in nostream-config, and the end-to-end case in nostream-admin.

On this branch, from e5a78d70:

Suite Result
cargo test -p nostream-config --test redaction 12 passed
cargo test -p nostream-admin --test write_path 5 passed
cargo test -p nostream-mcp --test tool_payloads 24 passed

The admin and MCP suites need TESTCONTAINERS_RYUK_DISABLED=true in a sandbox without the reaper.

A write-protected path with padding (admin.passwordHash ) is still refused, by the schema check rather than the guard; is_write_protected_settings_path compares the raw path and could normalize too, but this change does not touch it.

@changeset-bot

changeset-bot Bot commented Dec 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5b223bb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d23c6266-5b70-45ca-9da1-0b6391f2e45c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

The PR redacts secrets inside container-valued settings writes.

  • Settings writes now mask secrets nested inside whole blocks.

Reviews (1) · Last reviewed commit: "fix(admin): redact the secrets inside a ..." · Reviewed by Greptile

@cameri
cameri merged commit cb22d71 into rewrite/main Dec 2, 2026
30 of 31 checks passed
@cameri
cameri deleted the fix/1193-redact-container-settings-writes branch December 2, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants